import Vue from 'vue'
import Router from 'vue-router'
import index from '@/views/index'
import movieDetail from '@/views/movieDetail'
import movieSearch from '@/views/movieSearch'
import register from '@/views/register'
import login from '@/views/login'
import vipActivation from '@/views/vipActivation'
import vipGet from '@/views/vipGet'
import myVip from '@/views/myVip'
import myCollection from '@/views/myCollection'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      name: '首页',
      component: index,
      meta: {
        notRequireAuth: true
      },
      children: [{
        path: '/detail',
        name: '电影详情',
        component: movieDetail,
        meta: {
          notRequireAuth: true
        }
      },
      {
        path: '/search',
        name: '电影搜索',
        component: movieSearch,
        meta: {
          notRequireAuth: true
        }
      },
      {
        path: '/collection',
        name: '我的收藏',
        component: myCollection
      },
      {
        path: '/vipActivation',
        name: '激活驾照',
        component: vipActivation
      },
      {
        path: '/myVip',
        name: '我的驾照',
        component: myVip
      },
      {
        path: '/vipGet',
        name: '获取驾照',
        component: vipGet
      }]
    },
    {
      path: '/register',
      name: '注册',
      component: register,
      meta: {
        notRequireAuth: true
      }
    },
    {
      path: '/login',
      name: '登录',
      component: login,
      meta: {
        notRequireAuth: true
      }
    }
  ]
})
